package com.briup.es.web.controller;

import com.briup.es.config.response.Result;
import com.briup.es.domain.vo.AddressVO;
import com.briup.es.service.AddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "用户收货地址管理模块")
@RestController
@RequestMapping("/address")
public class AddressController {

    @Resource
    private AddressService addressService;

    @ApiOperation("获取所有的收获地址")
    @GetMapping
    public Result<?> queryAll() {
        List<AddressVO> addressVOS = addressService.queryAllByUserId();
        return Result.success(addressVOS)
                .apply("获取成功");
    }
}

